package com.catazy.base.presentation.nav

import androidx.navigation.NavDirections

/**
 * 作者: Tao
 * 日期: 2024/12/16
 * 时间: 15:08
 * 描述: 导航管理器
 */
class NavManager {

    // 导航事件监听器
    private var navEventListener: ((navDirections: NavDirections) -> Unit)? = null

    /**
     * 导航
     */
    fun navigate(navDirections: NavDirections) {
        navEventListener?.invoke(navDirections)
    }

    /**
     * 设置导航事件监听器
     */
    fun setNavEventListener(listener: (navDirections: NavDirections) -> Unit) {
        this.navEventListener = listener
    }
}